package entity;

import util.Util;

public class User {
    private String userName;
    private String userId;
    private int age;
    private String address;
    private String sex;
    private String userPassword;
    private String type;
    private String regdate;
    private String birth;

    public User() {
    }

    public User(String userName, String userId, String birth, String address, String sex, String userPassword, String type, String regdate) {
        this.userName = userName;
        this.userId = userId;
        this.birth = birth;
        this.age = Integer.parseInt(Util.getYear())-Integer.parseInt(birth.substring(0,4));
        this.address = address;
        this.sex = sex;
        this.userPassword = userPassword;
        this.type = type;
        this.regdate = regdate;
    }

    public String getBirth() {
        return birth;
    }

    public void setBirth(String birth) {
        this.birth = birth;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getAge() {
        return age=Integer.parseInt(Util.getYear())-Integer.parseInt(birth.substring(0,4));
    }

//    public void setAge(int age) {
//        this.age = age;
//    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRegdate() {
        return regdate;
    }

    public void setRegdate(String regdate) {
        this.regdate = regdate;
    }

}
